package com.apexcode.rabbitmqspringboot.listener;

import com.apexcode.rabbitmqspringboot.constant.Constants;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @ClassName WorkListener
 * @Description
 * @Author ZJX
 * @Date 2025/1/9 10:19
 * @Version 1.0
 **/

@Component
public class WorkListener {
    @RabbitListener(queues = Constants.WORK_QUEUE)
    public void queueListener(Message message){
        System.out.println("["+Constants.WORK_QUEUE+"] 接收到信息: " + message);
    }
}
